package com.yunji.hushuang.staticproxy;

import com.yunji.hushuang.common.HomeworkServiceImpl;
import com.yunji.hushuang.common.IHomeworkService;

/**
 * @author hushuang
 * @since 2019/10/14
 */
public class StaticProxyTest {

    public static void main(String[] args) {
        doHomeworkWithoutProxy();
        doHomeworkWithProxy();
    }

    private static void doHomeworkWithoutProxy() {
        IHomeworkService service = new HomeworkServiceImpl();
        service.doHomework();
    }

    private static void doHomeworkWithProxy() {
        IHomeworkService proxyService = new HomeworkProxyServiceImpl(new HomeworkServiceImpl());
        proxyService.doHomework();
    }
}
